package com.xu.sso.web.service;

import com.xu.sso.core.exception.SSOException;
import com.xu.sso.core.model.BaseResponse;
import com.xu.sso.db.model.base.AppRole;
import com.xu.sso.db.model.base.Resources;
import com.xu.sso.web.model.request.AddResRoleRequest;
import com.xu.sso.web.model.request.AddResourcesRequest;
import com.xu.sso.web.model.request.AddRoleRequest;
import com.xu.sso.web.model.request.AddUserRoleRequest;

import java.util.List;

public interface PowerService {

    List<Resources> findAllAppRes(String appId);

    Resources findResById(Integer id);

    BaseResponse addRes(AddResourcesRequest request) throws SSOException;

    BaseResponse updateRes(Resources resources) throws SSOException;

    BaseResponse deleteRes(Integer id) throws SSOException;

    BaseResponse refreshRedis(String appId) throws SSOException;

    BaseResponse checkRoleExist(String appId, String roleName) throws SSOException;

    BaseResponse addAppRole(AddRoleRequest request) throws SSOException;

    AppRole findAppRoleById(Integer id);

    BaseResponse deleteRoleById(Integer id) throws SSOException;

    BaseResponse updateRole(AppRole appRole) throws SSOException;

    BaseResponse updateRoleStatus(Integer id, String status) throws SSOException;

    BaseResponse addAppUser(String appId, String users) throws SSOException;

    List<AppRole> findInAppUserRole(String appId, String username);

    List<AppRole> findNotInAppUserRole(String appId, String username);

    BaseResponse addAppUserRole(AddUserRoleRequest request) throws SSOException;

    BaseResponse addResourcesRole(AddResRoleRequest request) throws SSOException;

    List<AppRole> findInResRole(String appId, Integer resId);

    List<AppRole> findNotInResRole(String appId, Integer resId);

}
